# Django settings for ce_atlas project.
import os.path


# uncomment if you want to use the production database and comment above two lines
#DATABASE_HOST = 'livingatlas.org'
#DATABASE_PORT = '5432'

ROOT = BASE_DIR = '/' + os.path.dirname(os.path.abspath(__file__)).strip("/")
BASE_APP = 'ce_atlas_app'
# Import settings_local
execfile(os.path.join(BASE_DIR, 'settings_local.py'))

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Vancouver'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

#PRIVATE_MAPFILE = os.path.join(ROOT,"mapserver","ce-atlas-private.map")
MAPFILE = os.path.join(ROOT,"mapserver","ce_atlas.map")

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(ROOT,'media')

USER_DATA = os.path.join(DATA_ROOT,'user_media_data')
IMAGE_DIR = os.path.join(DATA_ROOT,'rectified_images')
GROUP_IMAGES = os.path.join(DATA_ROOT,'group_images')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
#MEDIA_URL = 'http://ce-atlas-dev.ecotrust.ca/media/'
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media-admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '=zy)cggwlw9g!3atsk&$3=&%h=7_3n8sey-h@b$#=@wnlaio#d'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    #'django.middleware.csrf.CsrfViewMiddleware',
)

ROOT_URLCONF = 'livingatlas.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASE_DIR,BASE_APP,'templates'),
    #'/usr/local/django-trunk/django/contrib/admin/templates',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'django_evolution',
    'livingatlas.ce_atlas_app',
    'registration'
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'ce_atlas_app.context_processors.configure',
    'django.core.context_processors.auth'
    #'django.contrib.auth.context_processors.auth'
)

ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window
DEFAULT_FROM_EMAIL='livingatlas@ecotrust.ca'
EMAIL_HOST='mail.ecotrust.ca'
EMAIL_PORT=25
EMAIL_USE_TLS = False
EMAIL_HOST_USER = 'referrals'
ROOT_URLCONF = 'urls'

#If a new javascript file is added to the app, it must be added to this list
SCRIPTS = [
    'plugins/jquery.datePicker.js',
    'plugins/zeroclipboard.js',
    'plugins/jquery.sprite.js',
    'plugins/jbar/jquery.bar.js',
    'plugins/CeLayerSwitcher.js',
    'plugins/jquery.validate.js',
    'plugins/jquery.touch.js',
    'plugins/jquery.flot.js',
    'plugins/jqDnR.js',
    'plugins/jquery.stem.js',
    'oop.js',
    'jquery.micro-plugins.js',
    'plugins/CMP.js',
    'plugins/Menu.js',
    'date.js',
    'util.js',
    'data.js',
    'init.js',
    'openlayers_manager.js',
    'media_manager.js',
    'theme.js',
    'place.js',
    'tour.js',
    'widgets/widgets.js',
    'widgets/animation.js',
    'widgets/dialog.js',
    'widgets/legend.js',
    'widgets/slider.js',
    'widgets/tabs.js',
    'widgets/menu.js',
]
